﻿namespace RuoVea.Swms.Server.Models;

/// <summary>
/// 产品信息
/// </summary>
[SugarTable(nameof(WmsProduct), "产品信息")]
public class WmsProduct : EntityBase
{
    /// <summary>
    /// 产品编码
    /// </summary>
    [SugarColumn(ColumnDescription = "产品编码", IsNullable = false, Length = 50)]
    public string Code { get; set; }

    /// <summary>
    /// 产品名称
    /// </summary>
    [SugarColumn(ColumnDescription = "产品名称", IsNullable = false, Length = 100)]
    public string ProductName { get; set; }

    /// <summary>
    /// 产品规格
    /// </summary>
    [SugarColumn(ColumnDescription = "产品规格", Length = 100)]
    public string Specification { get; set; }

    /// <summary>
    /// 期初库存
    /// </summary>
    [SugarColumn(ColumnDescription = "期初库存", DefaultValue = "0")]
    public int InitialStock { get; set; }

    /// <summary>
    /// 当前库存
    /// </summary>
    [SugarColumn(ColumnDescription = "当前库存", DefaultValue = "0")]
    public int CurrentStock { get; set; }

    /// <summary>
    /// 类别ID
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public long CategoryId { get; set; }

    /// <summary>
    /// 位置ID
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public long LocationId { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true)]
    public string Remark { get; set; }

    /// <summary>
    /// 产品类别（导航属性）
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(CategoryId))]
    public WmsCategory Category { get; set; }

    /// <summary>
    /// 存放位置（导航属性）
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(LocationId))]
    public WmsLocation Location { get; set; }
}
